<?php

?>

<!-- Nav tabs -->
<div id="tab">
<ul class="nav nav-tabs" role="tablist">
  <li class="active"><a href="#system" >系统</a></li>
  <li><a href="#2">Profile</a></li>
  <li><a href="#3">Messages</a></li>
  <li><a href="#4">Settings</a></li>
</ul>
</div>
<form class="form-inline" role="form">
  <div class="form-group">
    <label for="info">变量说明</label>
    <input type="text" name="info" class="form-control" placeholder="变量说明">
  </div>
  <div class="form-group">
    <label for="name">变量名</label>
    <input type="text" name="name" class="form-control" placeholder="变量名">
  </div>
   <div class="form-group">
    <label for="exampleInputPassword2">类型</label>
	<select name="type" class="form-control">
		<option value='string' selected>文本</option>
		<option value='bool'>布尔</option>
		<option value='int'>数字</option>
		<option value='radio'>单选</option>
		<option value='checkbox'>多选</option>
		<option value='select'>下拉</option>
	</select>
    
  </div>
   <div class="form-group">
    <label  for="exampleInputPassword2">值</label>
    <input type="text" name="value" class="form-control">
  </div>
  <button type="submit" class="btn btn-default btn-sm">添加变量</button>
</form>
<!-- Tab panes -->
<?php
	$attrbutes = array();
	echo form_open('system/update',$attrbutes);
?>
<div class="tab-content"  id="panel">
  <div class="tab-pane active">
  <table cellspacing="0" class="table table-bordered table-hover table-striped">
  <thead><tr><td>说明</td><td>值</td><td>变量名</td></tr></thead>
  <tbody>
  <?php if($config):?>
	
	<?php
		foreach($config as $c){
	?>
		<tr>
			<td><?php echo $c['info']?></td>
			<td><?php echo $c['value']?></td>
			<td><?php echo $c['name']?></td>
		</tr>
	<?php
		}
	?>
  <?php else:?>
  
  <?php endif;?>
  </tbody>
  <table>
  </div>
  <div class="tab-pane"></div>
  <div class="tab-pane"></div>
  <div class="tab-pane"></div>
</div>
	<div class="actions-bar  centered">
			<input type="submit" class='button button-primary' checked="checked" value="保存"/>
			<input type="reset" class='button' checked="checked" value="重置"/>
	</div>
<?php echo form_close();?>
 <script type="text/javascript">
     
        var Tab = BUI.Tab
      
        var tab = new Tab.TabPanel({
          srcNode : '#tab',
          elCls : 'nav-tabs',
          itemStatusCls : {
            'selected' : 'active'
          },
          panelContainer : '#panel'//如果不指定容器的父元素，会自动生成
          //selectedEvent : 'mouseenter',//默认为click,可以更改事件
          
        });
 
        tab.render();
 
        
 
     
</script>